package com.thyme.controller;

import com.thyme.rocketmq.MessageProducer;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author thyme
 * @ClassName MqTestController
 * @Description TODO
 * @Date 2019/12/3 21:25
 */
@RestController
@RequestMapping("/mq")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class MqTestController {

    private final MessageProducer messageProducer;

    @RequestMapping("/sendMessage")
    public String sendMessage(@RequestParam String message) {
        messageProducer.sendMessage(message);
        return "ok";
    }
}
